const mock = require('mockjs')
const random = mock.Random


const returnQuestionList = (req)=>{
    const {page = 1,pagesize = 10,start = false,trash = false} = req.query
    const arrayList = []
    for(let i = 0;i<pagesize;i++){
        let obj = {
            _id:random.id(),
            title:random.title(),
            start:start ? start : random.boolean(),
            trash:trash ? trash : random.boolean(),
            ispublished:random.boolean(),
            createTime:random.date('yyyy-MM-dd HH:mm:ss'),
            count:random.natural(50, 100),
            deleted:false
        }
        arrayList.push(obj)
    }
    return arrayList
}

module.exports = returnQuestionList